function checkSsname() {
	var ssname = document.all.ssname.value;
	var span = document.getElementById("ssnameSpanId");
	var regex = /^[\u4E00-\u9FA5\w\d]{2,15}$/;
	if (!regex.test(ssname)) {
		span.innerHTML = "<img src='img/error.png' />收货人必须是2到15字符内";
		span.style.color = "red";
		return false;
	}
	span.innerHTML = "<img src='img/ok.gif' />";
	span.style.color = "green";
	return true;
}
function checkSsaddress() {
	var ssaddress = document.all.ssaddress.value;
	var span = document.getElementById("ssaddressSpanId");
	regx = /^[\u4E00-\u9FA5\w\d]{1,100}$/;
	if (!regx.test(ssaddress)) {
		span.innerHTML = "<img src='img/error.png' />输入地址长度小于100";
		span.style.color = "red";
		return false;
	}

	span.innerHTML = "<img src='img/ok.gif' />";
	span.style.color = "green";
	return true;
}

function checkSscode() {
	var sscode = document.all.sscode.value;
	var span = document.getElementById("sscodeSpanId");
	var s = /^\d{6}$/;
	if (!s.test(sscode)) {
		span.innerHTML = "<img src='img/error.png' />请6位数字的邮箱";
		span.style.color = "red";
		return false;
	}
	span.innerHTML = "<img src='img/ok.gif' />";
	span.style.color = "green";
	return true;
}

function checkSsemail() {
	var ssemail = document.all.ssemail.value;
	var span = document.getElementById("ssemailSpanId");
	regx = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
	if (!regx.test(ssemail)) {
		span.innerHTML = "<img src='img/error.png '/>请输入正确的邮箱！";
		span.style.color = "red";
		return false;
	}
	span.innerHTML = "<img src='img/ok.gif' />";
	span.style.color = "green";
	return true;
}

function checkSsphone() {
	var ssphone = document.all.ssphone.value;
	var span = document.getElementById("ssphoneSpanId");
	var s = /^\d{11}$/;

	if (!s.test(ssphone)) {
		span.innerHTML = "<img src='img/error.png' />请输入正确的电话号码";
		span.style.color = "red";
		return false;
	}
	span.innerHTML = "<img src='img/ok.gif' />";
	span.style.color = "green";
	return true;
}

function checkForm() {
	var ssnameFlag = checkSsname();
	var ssaddressFlag = checkSsaddress();
	var sscodeFlag = checkSscode();
	var  ssphoneFlag= checkSsphone();
	var ssemailFlag = checkSsemail();
	var flag = ssnameFlag && ssaddressFlag && sscodeFlag && ssphoneFlag && ssemailFlag;
	return flag;
}